﻿Imports System.Data.SqlClient
Imports TWIN_test.XLSgenerator

Public Class MyWorkshops
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        'gets the user name parameters for the on-load
        SqlDataSource1.SelectParameters.Item(0).DefaultValue = Membership.GetUser.UserName
        GridView2.DataBind()

    End Sub

    Protected Sub Button1_Click2(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Response.Redirect("EmployeeHome.aspx")
    End Sub

    Protected Sub GridView2_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles GridView2.SelectedIndexChanged
        'view a workshop by passign in the selected workshop'd ID as a primary key via queryString
        Response.Redirect("/Workshop_Management/WorkshopE/Register.aspx?id=" + GridView2.SelectedRow.Cells(1).Text)
    End Sub
End Class